function toHref(url){
	location.href = base.app+url;
} 

var form = layui.form;
var $ = layui.jquery;
var layer = layui.layer;
var laytpl = layui.laytpl;
var laypage = layui.laypage;

function formSubmit(event,url,dataType,func){
	form.on("submit("+event+")",function(data){
		ajax(url,data.field,dataType,func)
	})
}

function ajax(url,field,dataType,func){
	$.ajax({
			url : base.app + url,
			type : "post",
			data : field,//a=b&c=d / {a:b,c:d}
			dataType : dataType,
			success : func
		});
}
function layerConfirm(func,title){
	console.log(111)
	layer.confirm(title ? title : "确定进行该操作？",{
		icon : 3,
		title : "提示"
	},func)
}

function layerOpen(url,end){
	layer.open({
		type : 2,
		content : base.app + url,
		area : ['750px','500px'],
		fixed : false,
		maxmin : true,
		shade : 0.5,
		closeBtn : 2,
		shadeClose : false,
		success : function(layero,index){},
		end : end
	})
}
function layerClose(){//当你在iframe页面关闭自身时
	var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
	parent.layer.close(index); //再执行关闭
	
}

function pageInfo(elem,count,curr,limit,jump){
	laypage.render({
		elem : elem,
		count : count,
		curr : curr,
		limit : limit,
		limits : [10,20,30,40,50],
		layout : ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip'],
		jump : jump
	})
}
















